using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
using Microsoft.Xna.Framework.Content.Pipeline.Processors;
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;

using GameLib;

namespace GameContent
{
    [ContentTypeWriter]
    public class MapWriter : ContentTypeWriter<Map>
    {
        protected override void Write(ContentWriter output, Map value)
        {
            output.Write(value.Name);
            output.Write(value.Size);
            output.Write(value.TileSize);
            output.Write(value.TextureType);
            output.WriteObject<int[]>(value.BackgroundLayer);
            output.WriteObject<int[]>(value.BaseLayer);
            output.WriteObject<int[]>(value.ForegroundLayer);
        }

        public override string GetRuntimeReader(TargetPlatform targetPlatform)
        {  
            return typeof(GameLib.MapReader).AssemblyQualifiedName;
        }
    }
}
